{% extends "base.html" %} {% load static %} {%block nav %}
<div class="left"><a href="../">&lt; 后退</a></div>
<header>查询 IP 信息</header>
{% endblock %} {% block main %}
<section>
  <form action="./query" method="GET" novalidate>
    <label for="url">IP 或网址</label>
    <!-- the max lenght of host name is 253 -->
    <input
      type="url"
      name="url"
      maxlength="253"
      placeholder="请输入 IP 或网址"
      formnovalidate
      autofocus
    />
    <input type="submit" hidden />
  </form>
</section>
<section>
  <h1>归属地</h1>
  <ul>
    <li>
      <span>IP 地址</span>
      <span>{{ ip }}</span>
    </li>
    <li>
      <span>网络提供商</span>
      <span>{{ isp }}</span>
    </li>
    <li>
      <span>归属地</span>
      <span>{{ country }}, {{ province }}, {{ city }}</span>
    </li>
    {% if host %}
    <li>
      <span>主机名</span>
      <span>{{ host }}</span>
    </li>
    {% endif %}
  </ul>
  {% if host %}
  <p>注: 主机名可能对应多个 IP, 我们只显示了其中一个</p>
  {% endif %}
  <p>
    IP 归属地数据源:
    <a href="{{ database_href }}">{{ database_name }}</a>
  </p>
</section>
<!-- <section>
  <h1>更多域名信息</h1>
  <ul>
    {% for line in whois_host %}
    <li>
      <span> {{ line.0 }} </span>
      <span> {{ line.1 }} </span>
    </li>
    {% endfor %}
  </ul>
  <p>信息来源: whois {{ host }}</p>
</section> -->
<section>
  <h1>更多主机信息</h1>
  <ul>
    {% for line in whois_ip %}
    <li>
      <span> {{ line.0 }} </span>
      <span> {{ line.1 }} </span>
    </li>
    {% endfor %}
  </ul>
  <p>信息来源: whois {{ ip }}</p>
</section>
{% endblock %}
